<template>
  <div class="custom-form">
    <el-row :gutter="15">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" :key="showFormKey">
        <el-col :span="24">
          <el-form-item label-width="0" prop="field100bf13">
            <h2 align='center' style="color:undefined;font-size: nullpx;text-align: center">定标审批</h2>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('current_user_id')" v-show="false">
          <el-form-item :label="$t('当前用户')" prop="current_user_id">
            <avue-information-body :operationVal="operationVal" infoType='user' :whetherToRebindSecondaryEditing='false'
              v-model="formData['current_user_id']" placeholder="当前用户"
              :disabled="hasDisabledPermission('current_user_id', true)"
              :readonly="!hasEditPermission('current_user_id', true)" :style="{ width: '100%' }">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('job')" v-show="false">
          <el-form-item :label="$t('职级名称')" prop="job">
            <el-input v-model="formData['job']" placeholder="请输入职级名称" :disabled="hasDisabledPermission('job', false)"
              :readonly="!hasEditPermission('job', false)" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('role_id')" v-show="false">
          <el-form-item :label="$t('角色ID')" prop="role_id">
            <el-input v-model="formData['role_id']" placeholder="请输入角色ID"
              :disabled="hasDisabledPermission('role_id', false)" :readonly="!hasEditPermission('role_id', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('role_name')" v-show="false">
          <el-form-item :label="$t('角色名称')" prop="role_name">
            <el-input v-model="formData['role_name']" placeholder="请输入角色名称"
              :disabled="hasDisabledPermission('role_name', false)" :readonly="!hasEditPermission('role_name', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('area')" v-show="false">
          <el-form-item :label="$t('地区')" prop="area">
            <el-input v-model="formData['area']" placeholder="请输入地区" :disabled="hasDisabledPermission('area', false)"
              :readonly="!hasEditPermission('area', false)" clearable :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('user_id')" v-show="false">
          <el-form-item :label="$t('申请人ID')" prop="user_id">
            <el-input v-model="formData['user_id']" placeholder="请输入申请人ID"
              :disabled="hasDisabledPermission('user_id', false)" :readonly="!hasEditPermission('user_id', false)"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('user_name')">
          <el-form-item :label="$t('申请人名称')" prop="user_name">
            <el-input v-model="formData['user_name']" placeholder="请输入申请人名称"
              :disabled="hasDisabledPermission('user_name', false)" 
              :readonly="true"
              clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('apply_time')" v-show="false">
          <el-form-item :label="$t('申请时间')" prop="apply_time">
            <avue-information-body :operationVal="operationVal" infoType='date' :whetherToRebindSecondaryEditing='false'
              v-model="formData['apply_time']" placeholder="当前时间" :disabled="hasDisabledPermission('apply_time', true)"
              :readonly="!hasEditPermission('apply_time', true)" :style="{ width: '100%' }">
            </avue-information-body>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('depart_short_name')" v-show="false">
          <el-form-item :label="$t('部门简称')" prop="depart_short_name">
            <el-input v-model="formData['depart_short_name']" placeholder="请输入部门简称"
              :disabled="hasDisabledPermission('depart_short_name', false)"
              :readonly="!hasEditPermission('depart_short_name', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('depart_id')">
          <el-form-item :label="$t('部门')" prop="depart_id">
            <el-select v-model="formData['depart_id']" placeholder="请选择部门ID"
              :disabled="hasDisabledPermission('depart_id', false)" @change="departmentChange" filterable clearable
              :style="{ width: '100%' }">
              <el-option v-for="(item, index) in departmentData" :key="index" :label="item.F_FullName"
                :value="item.F_DepartmentId" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('is_effective')" v-show="false">
          <el-form-item :label="$t('是否生效')" prop="is_effective">
            <el-input v-model="formData['is_effective']" :disabled="hasDisabledPermission('is_effective', false)"
              :readonly="!hasEditPermission('is_effective', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('determine_mark_approval')">
          <el-form-item :label="$t('招标审批')" prop="determine_mark_approval">
            <el-input v-model="formData['determine_mark_approval']" placeholder="请输入招标审批"
              :disabled="hasDisabledPermission('determine_mark_approval', false)" @focus="selectApprovalForm(1)"
              :readonly="!hasEditPermission('determine_mark_approval', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 招标审批单 -->
        <el-col :span="24" v-show="selectData.length > 0">
          <el-form-item label="">
            <div class="del_items" v-for="(item, index) in selectData" :key="index">
              <div class="del-items-left"><img src="../../../assets/card/file.png"></div>
              <div class="del-items-middle">{{ item.startUser }}提交的{{ item.schemeName }}</div>
              <div class="del-items-refuse" v-if="item.status == 0">审批拒绝</div>
              <div class="del-items-adopt" v-else-if="item.status == 1">审批通过</div>
              <div class="del-items-processing" v-else>审批中</div>
              <div class="del-items-close" @click="delApproval(item, index)"><img src="../../../assets/card/close.png">
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('approval_code')">
          <el-form-item :label="$t('审批编码')" prop="approval_code">
            <el-input v-model="formData['approval_code']" placeholder="请输入审批编码"
              :disabled="hasDisabledPermission('approval_code', false)"
              :readonly="!hasEditPermission('approval_code', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('determine_mark_type')">
          <el-form-item :label="$t('定标类型')" prop="determine_mark_type">
            <el-select v-model="formData['determine_mark_type']" placeholder="请选择定标类型"
              :disabled="hasDisabledPermission('determine_mark_type', false)" filterable clearable
              :style="{ width: '100%' }">
              <el-option v-for="(item, index) in determine_mark_typeOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('determine_mark_type_des') && formData.determine_mark_type == 11">
          <el-form-item :label="$t('其他说明')" prop="determine_mark_type_des">
            <el-input v-model="formData['determine_mark_type_des']" type="textarea" placeholder="请输入其他说明"
              :disabled="hasDisabledPermission('determine_mark_type_des', false)"
              :readonly="!hasEditPermission('determine_mark_type_des', false)" :autosize="{ minRows: 4, maxRows: 4 }"
              :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('determine_mark_ways')">
          <el-form-item :label="$t('定标方式')" prop="determine_mark_ways">
            <el-select v-model="formData['determine_mark_ways']" placeholder="请选择定标方式"
              :disabled="hasDisabledPermission('determine_mark_ways', false)" filterable clearable
              :style="{ width: '100%' }">
              <el-option v-for="(item, index) in determine_mark_waysOptions" :key="index" :label="item.F_ItemName"
                :value="item.F_ItemValue" :disabled="item.disabled"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('determine_mark_provider') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2)">
          <el-form-item :label="$t('拟定标供应商')" prop="determine_mark_provider">
            <el-input v-model="formData['determine_mark_provider']" placeholder="请输入拟定标供应商"
              :disabled="hasDisabledPermission('determine_mark_provider', false)" @focus="selectApprovalForm(2)"
              :readonly="!hasEditPermission('determine_mark_provider', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 拟定标供应商 -->
        <el-col :span="24" v-show="selectData2.length > 0">
          <el-form-item label="">
            <div class="del_items" v-for="(item, index) in selectData2" :key="index">
              <div class="del-items-left"><img src="../../../assets/card/file.png"></div>
              <div class="del-items-middle">{{ item.startUser }}提交的{{ item.schemeName }}</div>
              <div class="del-items-refuse" v-if="item.status == 0">审批拒绝</div>
              <div class="del-items-adopt" v-else-if="item.status == 1">审批通过</div>
              <div class="del-items-processing" v-else>审批中</div>
              <div class="del-items-close" @click="delApproval2(item, index)"><img src="../../../assets/card/close.png">
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('determine_mark_name') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 3 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('标的名称')" prop="determine_mark_name">
            <el-input v-model="formData['determine_mark_name']" placeholder="请输入标的名称"
              :disabled="hasDisabledPermission('determine_mark_name', false)"
              :readonly="!hasEditPermission('determine_mark_name', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('determine_mark_number') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 3 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('标的数量')" prop="determine_mark_number">
            <el-input v-model="formData['determine_mark_number']" placeholder="请输入标的数量"
              :disabled="hasDisabledPermission('determine_mark_number', false)"
              :readonly="!hasEditPermission('determine_mark_number', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('determine_mark_model') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 3 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('型号')" prop="determine_mark_model">
            <el-input v-model="formData['determine_mark_model']" placeholder="请输入型号"
              :disabled="hasDisabledPermission('determine_mark_model', false)"
              :readonly="!hasEditPermission('determine_mark_model', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('other_des') && formData.determine_mark_ways == 4">
          <el-form-item :label="$t('其他说明')" prop="other_des">
            <el-input v-model="formData['other_des']" type="textarea" placeholder="请输入其他说明"
              :disabled="hasDisabledPermission('other_des', false)" :readonly="!hasEditPermission('other_des', false)"
              :autosize="{ minRows: 4, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('determine_mark_amount') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 3 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('金额')" prop="determine_mark_amount">
            <el-input v-model="formData['determine_mark_amount']" type="number" placeholder="请输入金额"
              :disabled="hasDisabledPermission('determine_mark_amount', false)"
              :readonly="!hasEditPermission('determine_mark_amount', false)" clearable :style="{ width: '100%' }">
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('duration_date') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 3 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('工期时间')" prop="duration_date">
            <el-input v-model="formData['duration_date']" placeholder="请输入工期时间"
              :disabled="hasDisabledPermission('duration_date', false)"
              :readonly="!hasEditPermission('duration_date', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('meeting_minutes_url') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 3 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('定标会议纪要')" prop="meeting_minutes_url">
            <xjr-custom-upload :config="meeting_minutes_urlConfig"
              :disabled="hasDisabledPermission('meeting_minutes_url', false)" v-model="formData['meeting_minutes_url']"
              list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24"
          v-if="hasFormPermission('meeting_file_url') && (formData.determine_mark_ways == 1 || formData.determine_mark_ways == 2 || formData.determine_mark_ways == 4)">
          <el-form-item :label="$t('定标文件')" prop="meeting_file_url">
            <xjr-custom-upload :config="meeting_file_urlConfig"
              :disabled="hasDisabledPermission('meeting_file_url', false)" v-model="formData['meeting_file_url']"
              list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('notice_url') && formData.determine_mark_ways == 1">
          <el-form-item :label="$t('中标通知书最终版')" prop="notice_url">
            <xjr-custom-upload :config="notice_urlConfig" :disabled="hasDisabledPermission('notice_url', false)"
              v-model="formData['notice_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('other_url') && formData.determine_mark_ways == 2">
          <el-form-item :label="$t('考察报告及其他附件')" prop="other_url">
            <xjr-custom-upload :config="other_urlConfig" :disabled="hasDisabledPermission('other_url', false)"
              v-model="formData['other_url']" list-type="text"></xjr-custom-upload>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasFormPermission('provider_approval') && formData.determine_mark_ways == 3">
          <el-form-item :label="$t('指定供应商审批单')" prop="provider_approval">
            <el-input v-model="formData['provider_approval']" placeholder="请输入指定供应商审批单"
              :disabled="hasDisabledPermission('provider_approval', false)" @focus="selectApprovalForm(3)"
              :readonly="!hasEditPermission('provider_approval', false)" clearable :style="{ width: '100%' }">
            </el-input>
          </el-form-item>
        </el-col>
        <!-- 指定供应商审批单 -->
        <el-col :span="24" v-show="selectData3.length > 0">
          <el-form-item label="">
            <div class="del_items" v-for="(item, index) in selectData3" :key="index">
              <div class="del-items-left"><img src="../../../assets/card/file.png"></div>
              <div class="del-items-middle">{{ item.startUser }}提交的{{ item.schemeName }}</div> 
              <div class="del-items-refuse" v-if="item.status == 0">审批拒绝</div>
              <div class="del-items-adopt" v-else-if="item.status == 1">审批通过</div>
              <div class="del-items-processing" v-else>审批中</div>
              <div class="del-items-close" @click="delApproval3(item, index)"><img src="../../../assets/card/close.png">
              </div>
            </div>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="0" prop="field131ec81">
            <div style="border-top: 1px solid #dcdfe6;margin-top: 0px;margin-bottom: 0px;"></div>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="hasWorkFlowFormPermission('field1328bcc')" v-show="optionsFlag">
          <el-form-item :label="$t('意见簿')" prop="field1328bcc">
            <xjr-opinion-comonent :value="formData.field1328bcc"></xjr-opinion-comonent>
          </el-form-item>
        </el-col>
        <el-col :span="24" v-if="!isWorkflowForm">
          <el-form-item size="large" v-if="isEdit">
            <el-button type="primary" @click="submitForm" :loading="submitLoading">
              {{ submitLoading ? $t('workFlow.WFMenu.hintSubmit') : $t('submit') }}</el-button>
            <el-button @click="cancelForm">{{ $t('cancelText') }}</el-button>
          </el-form-item>
        </el-col>
      </el-form>
    </el-row>
    <!-- 定标审批单 -->
    <el-dialog append-to-body title="关联审批单" :visible.sync="approvalFormVisible" width="880px"
      :before-close="handleClose">
      <DetermienApproval ref='approval' />
      <span slot="footer" class="dialog-footer">
        <div class="height16"></div>
        <el-button @click="approvalFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="sure">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 最低价---实地考察 -->
    <el-dialog append-to-body title="关联审批单" :visible.sync="approvalFormVisible2" width="880px"
      :before-close="handleClose">
      <DetermienApproval2 ref="approval2" />
      <span slot="footer" class="dialog-footer">
        <div class="height16"></div>
        <el-button @click="approvalFormVisible2 = false">取 消</el-button>
        <el-button type="primary" @click="sure2">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 指定厂家 -->
    <el-dialog append-to-body title="关联审批单" :visible.sync="approvalFormVisible3" width="880px"
      :before-close="handleClose">
      <DetermienApproval3 ref="approval3" />
      <span slot="footer" class="dialog-footer">
        <div class="height16"></div>
        <el-button @click="approvalFormVisible3 = false">取 消</el-button>
        <el-button type="primary" @click="sure3">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>

import FilterableDataList from '@/components/generator/clientComponents/FilterableDataList.vue';
import workflowFormAuthorize from "@/mixins/workflowFormAuthorize";
import authorizeMixin from "@/mixins/authorize";
import { baseUrl } from "@/config/env";
import request from "@/router/axios";
import { getUserDetailsById } from '@/api/user.js';
import DetermienApproval from '../components/determienApproval.vue'
import DetermienApproval2 from '../components/determienApproval2.vue'
import DetermienApproval3 from '../components/determienApproval3.vue'
export default {
  mixins: [authorizeMixin, workflowFormAuthorize],

  components: { DetermienApproval, DetermienApproval2, DetermienApproval3 },
  props: ['keyValue', 'isEdit', 'disabled'],
  data() {
    let _this = this
    return {
      submitLoading: false,
      showForm: true,
      showFormKey: 1,
      reRenderSubform: false,
      operationVal: 'add',
      isAdd: true,
      addressUrl: 'determinemarkapproval',
      mainTableName: 'oa_determine_mark_approval',
      formConfig: {},
      formData: {
        'field100bf13': '',
        'current_user_id': '',
        'job': '',
        'role_id': '',
        'role_name': '',
        'area': '',
        'user_id': '',
        'user_name': '',
        'apply_time': '',
        'depart_short_name': '',
        'depart_id': '',
        'is_effective': "0",
        'determine_mark_approval': '',
        'approval_code': '',
        'determine_mark_type': '',
        'determine_mark_type_des': '',
        'determine_mark_ways': '',
        'determine_mark_provider': '',
        'determine_mark_name': '',
        'determine_mark_number': '',
        'determine_mark_model': '',
        'other_des': '',
        'determine_mark_amount': "",
        'duration_date': '',
        'meeting_minutes_url': null,
        'meeting_file_url': null,
        'notice_url': null,
        'other_url': null,
        'provider_approval': '',
        'field131ec81': '',
        'field1328bcc': null,
      },
      rules: {
        job: [{
          required: true,
          message: '请输入职级名称',
          trigger: 'blur'
        }],
        role_id: [{
          required: true,
          message: '请输入角色ID',
          trigger: 'blur'
        }],
        role_name: [{
          required: true,
          message: '请输入角色名称',
          trigger: 'blur'
        }],
        area: [{
          required: true,
          message: '请输入地区',
          trigger: 'blur'
        }],
        user_id: [{
          required: true,
          message: '请输入申请人ID',
          trigger: 'blur'
        }],
        user_name: [{
          required: true,
          message: '请输入申请人名称',
          trigger: 'blur'
        }],
        depart_short_name: [{
          required: true,
          message: '请输入部门简称',
          trigger: 'blur'
        }],
        depart_id: [{
          required: true,
          message: '请选择部门ID',
          trigger: 'change'
        }],
        is_effective: [{
          required: true,
          message: '',
          trigger: 'blur'
        }],
        determine_mark_approval: [{
          required: true,
          message: '请输入招标审批',
          trigger: 'blur'
        }],
        approval_code: [{
          required: true,
          message: '请输入审批编码',
          trigger: 'blur'
        }],
        determine_mark_type: [{
          required: true,
          message: '请选择定标类型',
          trigger: 'change'
        }],
        determine_mark_type_des: [],
        determine_mark_ways: [{
          required: true,
          message: '请选择定标方式',
          trigger: 'change'
        }],
        determine_mark_provider: [],
        determine_mark_name: [{
          required: true,
          message: '请输入标的名称',
          trigger: 'blur'
        }],
        determine_mark_number: [{
          required: true,
          message: '请输入标的数量',
          trigger: 'blur'
        }],
        determine_mark_model: [{
          required: true,
          message: '请输入型号',
          trigger: 'blur'
        }],
        other_des: [{
          required: true,
          message: '请输入说明',
          trigger: 'blur'
        }],
        determine_mark_amount: [{
          required: true,
          message: '请输入金额',
          trigger: 'blur'
        }],
        duration_date: [{
          required: true,
          message: '请输入工期时间',
          trigger: 'blur'
        }],
        meeting_minutes_url: [],
        meeting_file_url: [],
        notice_url: [],
        other_url: [],
        provider_approval: [{
          required: true,
          message: '请输入指定供应商审批单',
          trigger: 'blur'
        }],
      },
      departmentData: [],//部门信息
      roleData: [],//角色信息
      determine_mark_typeOptions: [],
      determine_mark_waysOptions: [],
      approvalFormVisible: false,
      selectData: [],
      approvalFormVisible2: false,
      selectData2: [],
      approvalFormVisible3: false,
      selectData3: [],
      meeting_minutes_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
      meeting_file_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
      notice_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
      other_urlConfig: {
        "showTip": false,
        "fileSize": 2,
        "sizeUnit": "MB",
        "buttonText": "点击上传",
        "disabled": false
      },
    }
  },
  computed: {},
  watch: {
    'formData.determine_mark_amount': function (val, oldVal) {
      this.changeFormConfigDefaultValue();
    },
  },
  created() {
    this.formConfig = this.getFormConfig();
  },
  async mounted() {
    //TODO   再这里做数据回填 请求表单数据

    if (this.keyValue) {
      this.isAdd = false;
    }
    if (!this.isAdd && this.keyValue) {
      this.operationVal = 'edit';
      try {
        let res = await request({
          url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
          method: "get",
        });

        this.formData = res.data.data

        this.showFormKey++;
      } catch (error) {
      }
    }


    if (typeof this.getDetermine_mark_typeOptions == "function") {
      await this.getDetermine_mark_typeOptions();
    }
    if (typeof this.getDetermine_mark_waysOptions == "function") {
      await this.getDetermine_mark_waysOptions();
    }
    // 新增时获取信息表单反选
    await this.getCurrentInfo()
  },
  methods: {
    getCurrentInfo() {
      let params = {
        userId: this.formData['current_user_id']
      }
      getUserDetailsById(params).then(res => {
        this.formData['user_id'] = res.data.data.F_UserId//当前申请人id
        this.formData['user_name'] = res.data.data.F_RealName//当前申请人姓名
        this.formData['area'] = res.data.data.F_Area//地区
        this.formData['job'] = res.data.data.F_Job//职级
        this.departmentData = res.data.data.F_Department//部门信息
        this.roleData = res.data.data.F_Role//角色信息
        this.initRole()
        this.initDepartmentData()
      })
    },
    initDepartmentData(){
      if(this.departmentData && this.departmentData.length == 1){
        this.formData['depart_short_name'] = this.departmentData[0].F_FullName
        this.formData['depart_id'] = this.departmentData[0].F_DepartmentId
      }
    },
    initRole() {
      let roleId = []
      let roleName = []
      if (this.roleData && this.roleData.length > 0) {
        this.roleData.forEach(e => {
          roleId.push(e.F_RoleId)
          roleName.push(e.F_FullName)
        })
      }
      this.formData['role_id'] = roleId.join(',')
      this.formData['role_name'] = roleName.join(',')
      this.formData['apply_time'] = this.getTime()
    },
    getTime() {
      let today = new Date()
      let year = today.getFullYear();
      let month = today.getMonth() + 1;//获取月份，值为0-11 表示1-12月份
      if (month <= 9) {
        month = "0" + month
      }
      let date = today.getDate();
      if (date <= 9) {
        date = "0" + date
      }
      let hours = today.getHours();
      if (hours <= 9) {
        hours = "0" + hours
      }
      let minutes = today.getMinutes()
      if (minutes <= 9) {
        minutes = "0" + minutes
      }
      let seconds = today.getSeconds();
      if (seconds <= 9) {
        seconds = "0" + seconds
      }
      let time = year + "-" + month + "-" + date + " " + hours + ":" + minutes + ":" + seconds
      return time
    },
    // 部门选择
    departmentChange(val) {
      this.departmentData.forEach(ele => {
        if (val == ele.F_DepartmentId) {
          this.formData['depart_short_name'] = ele.F_FullName
        }
      })
    },
    getFormData() {
      let key = this.mainTableName + 'Entity';
      let returnParams = {};
      returnParams[key] = this.formData;
      return {
        ...returnParams,
      };
    },
    validateForm() {
      this.$refs['elForm'].validate(valid => { });
    },
    async aysncValidateForm() {
      let validataArry = []
      validataArry.push(new Promise((resolve, reject) => {
        this.$refs['elForm'].validate(valid => {
          resolve(valid)
        })
      }))
      let res = await Promise.all(validataArry)
      if (res.includes(false)) {
        return false
      }
      else {
        return true;
      }
    },
    changeTableData() { },
    async submitForm() {
      this.submitLoading = true;
      let valid = await this.aysncValidateForm();
      if (valid == false) {
        this.submitLoading = false;
        return false;
      }
      this.changeTableData();
      //格式化数据
      let newObj = this.getFormData();

      //如果没有传入参数就是新增
      if (!this.keyValue) {

        request({
          url: baseUrl + "/" + this.addressUrl,
          method: "post",
          data: newObj
        }).then((res) => {
          this.submitLoading = false;
          this.$notify({
            title: "成功",
            message: "新增成功",
            type: "success",
          });
          this.$emit("onChange", true)
        });

      }
      else {

        request({
          url: baseUrl + "/" + this.addressUrl + "/" + this.keyValue,
          method: "put",
          data: newObj
        }).then((res) => {
          this.submitLoading = false;
          this.$notify({
            title: "成功",
            message: "修改成功",
            type: "success",
          });
          this.$emit("onChange", true)
        });

      }



    },
    cancelForm() {
      this.$emit("onChange", true)
    },
    formatTree(data, valueField, lableField, childField, type) {
      let tree = [];
      data.forEach((node, index) => {
        let newNode = {
          value: node[valueField],
          label: node[lableField],
        };
        if (type) {
          newNode.disabled = node[valueField] == undefined ? true : false
        }
        tree.push(newNode);
        if (node[childField] != null && node[childField].length > 0) {
          newNode.children = (this.formatTree(node[childField], valueField, lableField, childField,
            type));
        }
      }, this);
      return tree;
    },

    //辅助工作流 审批(编辑) 预留方法
    handleEdit() {
    },

    getNumberFixed2(number) {
      let splitNum = ("" + number).replace(/(^0*)/g, "").split(".");
      let num = splitNum[0] == "" ? '0' : splitNum[0];
      if (splitNum.length > 1) {
        num += '.';
        let roundNum = 2; //保留两位小数
        for (let i = 0; i < roundNum; i++) {
          num += splitNum[1][i];
        }
      }
      return parseFloat(num);
    },
    changeFormConfigDefaultValue() {
      let valueForFormIdMap = new Map();
      this.formConfig.fields.forEach((ele) => {
        if (ele.__config__.componentName == "table") {
          ele.__config__.children.forEach((element) => {
            valueForFormIdMap.set(ele.__config__.formId + "-table-" + element.__config__.formId,
              element.__config__.defaultValue);
          });
        }
        else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
          let childrenObj = ele.__config__.childrenObj || {};
          let _arr = this.getValByTabs(childrenObj);
          _arr.map(item => {
            valueForFormIdMap.set(item.formId, item.defaultValue);
          });
        }
        else {
          valueForFormIdMap.set(ele.__config__.formId, this.formData[ele.__vModel__]);
        }
      });
      this.formConfig.fields.forEach((ele, index) => {
        if (ele.__config__.componentName == "table") {
          ele.__config__.children.forEach((element, childrenIndex) => {
            let defaultValue = 0;
            if (element.computationalConfiguration && element.computationalConfiguration.length > 0) {
              let formulaStr = "";
              element.computationalConfiguration.forEach((item) => {
                if (item.type == "taxRate") {
                  //税率
                  if (element.taxRate >= 0) {
                    formulaStr += element.taxRate * 0.01;
                  }
                }
                else {
                  let eleValue = valueForFormIdMap.get(item.formId) || 0;
                  formulaStr += item.formId == 0 ? item.name : eleValue;
                }
              });
              defaultValue = eval(formulaStr);
              defaultValue = this.getNumberFixed2(defaultValue);
              //大写
              if (element.isCapitalized) {
                this.formConfig.fields[index].__config__.children[childrenIndex].__config__
                  .capitalizedValue = this.getCapitalizedMethod(defaultValue);
              }
              this.formConfig.fields[index].__config__.children[childrenIndex].__config__
                .defaultValue = defaultValue;
              this.formData[element.__vModel__] = defaultValue;
            }
          });
        }
        else if (ele.__config__.componentName && ele.__config__.componentName == 'avue-tabs') {
          let childrenObj = ele.__config__.childrenObj || {};
          //avue-tabs
          this.calcDefaultValueByTabs(ele.__config__.childrenObj, valueForFormIdMap);
        }
        else {
          let defaultValue = 0;
          if (ele.computationalConfiguration && ele.computationalConfiguration.length > 0) {
            let formulaStr = "";
            ele.computationalConfiguration.forEach((item) => {
              if (item.type == "taxRate") {
                //税率
                if (ele.taxRate >= 0) {
                  formulaStr += ele.taxRate * 0.01;
                }
              }
              else {
                let eleValue = valueForFormIdMap.get(item.formId) || 0;
                formulaStr += item.formId == 0 ? item.name : eleValue;
              }
            });
            defaultValue = eval(formulaStr);
            defaultValue = this.getNumberFixed2(defaultValue);
            //大写
            if (ele.isCapitalized) {
              this.formConfig.fields[index].__config__.capitalizedValue = this.getCapitalizedMethod(
                defaultValue);
            }
            this.formConfig.fields[index].__config__.defaultValue = defaultValue;
            this.formData[ele.__vModel__] = defaultValue;
          }
        }
      });
    },
    getValByTabs(childrenObj) {
      let _arr = [];
      if (!childrenObj || !(childrenObj instanceof Object)) return [];
      for (let key in childrenObj) {
        let children = childrenObj[key];
        children.map(item => {
          if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
            let cObj = item.__config__.childrenObj || {};
            _arr.push(...this.getValByTabs(item.__config__.childrenObj));
          }
          else {
            let _obj = {};
            _obj.formId = item.__config__.formId;
            _obj.defaultValue = this.formData[item.__vModel__];
            _arr.push(_obj);
          }
        });
      }
      return (() => {
        return _arr;
      })()
    },
    calcDefaultValueByTabs(childrenObj, valueForFormIdMap) {
      if (!childrenObj || !(childrenObj instanceof Object)) return;
      for (let key in childrenObj) {
        let children = childrenObj[key];
        children.map(item => {
          if (item.__config__.componentName && item.__config__.componentName == 'avue-tabs') {
            let cObj = item.__config__.childrenObj || {};
            this.calcDefaultValueByTabs(cObj, valueForFormIdMap);
          }
          else {
            let defaultValue = 0;
            if (item.computationalConfiguration && item.computationalConfiguration.length > 0) {
              let formulaStr = "";
              item.computationalConfiguration.forEach((c) => {
                if (item.type == "taxRate") {
                  //税率
                  if (item.taxRate >= 0) {
                    formulaStr += item.taxRate * 0.01;
                  }
                }
                else {
                  let eleValue = valueForFormIdMap.get(c.formId) || 0;
                  formulaStr += c.formId == 0 ? c.name : eleValue;
                }
              });
              defaultValue = eval(formulaStr);
              defaultValue = this.getNumberFixed2(defaultValue);
              item.__config__.defaultValue = defaultValue;
              this.formData[item.__vModel__] = defaultValue;
            }
          }
        });
      }
    },
    async getDetermine_mark_typeOptions() {
      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {
        let resp = await this.$axios({
          method: 'get',
          url: baseUrl + '/data-items/dblx/detail',
        });
        if (resp.data.data) {
          this.determine_mark_typeOptions = resp.data.data;
        }
      }
      catch (error) { }
    },
    async getDetermine_mark_waysOptions() {
      // 注意：this.$axios是通过Vue.prototype.$axios = axios挂载产生的
      try {
        let resp = await this.$axios({
          method: 'get',
          url: baseUrl + '/data-items/dbfs/detail',
        });
        if (resp.data.data) {
          this.determine_mark_waysOptions = resp.data.data;
        }
      }
      catch (error) { }
    },
    //子表单权限
    getAuthorityTableChildrenList(bindTable, children) {
      let column = [];
      if (bindTable && this.formEnCodeList && this.formEnCodeList[bindTable]) {
        let formSubEnCodeList = this.formEnCodeList[bindTable];
        if (children && children.length > 0) {
          column = children.map(ele2 => {
            if (formSubEnCodeList.includes(ele2.prop)) {
              ele2.hide = false;
            }
            else {
              ele2.hide = true;
            }
            if (ele2.hide == false) {
              //工作流中系统表单必填权限
              if (this.formSubTableNotRequiredList[bindTable] != undefined) {
                if (this.formSubTableNotRequiredList[bindTable].includes(ele2.prop)) {
                  ele2.required = false;
                }
                else {
                  ele2.required = true;
                }
              }
              ele2.rules = [];
              if (ele2.required) {
                ele2.rules = ele2.ruleList;
              }
              // disabled 属性
              if (this.formSubTableDisabledList[bindTable] != undefined) {
                if (this.formSubTableDisabledList[bindTable].includes(ele2.prop)) {
                  ele2.disabled = true;
                }
                else {
                  ele2.disabled = false;
                }
              }
            }
            return ele2;
          });
        }
        return column;
      }
      else {
        return children;
      }
    },
    getFormConfig() {
      let config = {
        "fields": [{
          "__vModel__": "field100bf13",
          "__config__": {
            "label": "定标审批",
            "showLabel": false,
            "titleColor": null,
            "fontSize": null,
            "tag": "h2",
            "span": 24,
            "align": "top",
            "justify": "start",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 100
          }
        }, {
          "__vModel__": "current_user_id",
          "__type__": "info",
          "infoType": "user",
          "__organize__": true,
          "__config__": {
            "label": "当前用户",
            "showLabel": true,
            "tag": "avue-information-body",
            "avueType": "information-body",
            "defaultValue": "316231f32f1f0e5a4c56bf855806b924",
            "required": false,
            "span": 24,
            "whetherToRebindSecondaryEditing": false,
            "bindTableField": "current_user_id",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 101,
            "placeholder": "当前用户",
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "job",
          "__config__": {
            "label": "职级名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 102,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "job",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "role_id",
          "__config__": {
            "label": "角色ID",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 103,
            "fieldLength": 500,
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "role_id",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "role_name",
          "__config__": {
            "label": "角色名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 104,
            "fieldLength": 500,
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "role_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "area",
          "__config__": {
            "label": "地区",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 105,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "area",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "user_id",
          "__config__": {
            "label": "申请人ID",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 106,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "user_id",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "user_name",
          "__config__": {
            "label": "申请人名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 107,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "user_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "apply_time",
          "__type__": "info",
          "infoType": "date",
          "__organize__": true,
          "__config__": {
            "label": "申请时间",
            "showLabel": true,
            "tag": "avue-information-body",
            "avueType": "information-body",
            "defaultValue": "2022-07-11 14:23:05",
            "required": false,
            "span": 24,
            "whetherToRebindSecondaryEditing": false,
            "bindTableField": "apply_time",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 109,
            "placeholder": "当前时间",
            "fieldLength": "100",
            "bindTable": "oa_determine_mark_approval",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "depart_short_name",
          "__config__": {
            "label": "部门简称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 110,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "depart_short_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "depart_id",
          "__config__": {
            "label": "部门ID",
            "showLabel": true,
            "tag": "el-select",
            "avueType": "select",
            "span": 24,
            "required": true,
            "saveField": "",
            "showField": "",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 111,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "depart_id",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "is_effective",
          "__config__": {
            "label": "是否生效",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "defaultValue": "0",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 112,
            "fieldLength": "10",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "is_effective",
            "bindTableFieldType": "int"
          }
        }, {
          "__vModel__": "determine_mark_approval",
          "__config__": {
            "label": "招标审批",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 113,
            "fieldLength": 500,
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_approval",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "approval_code",
          "__config__": {
            "label": "审批编码",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 114,
            "fieldLength": "100",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "approval_code",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "determine_mark_type",
          "__config__": {
            "label": "定标类型",
            "showLabel": true,
            "tag": "el-select",
            "avueType": "select",
            "span": 24,
            "required": true,
            "saveField": "",
            "showField": "",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 115,
            "dataType": "dataItem",
            "dataItem": "dblx",
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_type",
            "bindTableFieldType": "varchar"
          }
        }, {
          "tempType": "textarea",
          "__vModel__": "determine_mark_type_des",
          "__config__": {
            "label": "其他说明",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "textarea",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 117,
            "fieldLength": 2000,
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_type_des",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "determine_mark_ways",
          "__config__": {
            "label": "定标方式",
            "showLabel": true,
            "tag": "el-select",
            "avueType": "select",
            "span": 24,
            "required": true,
            "saveField": "",
            "showField": "",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 118,
            "dataType": "dataItem",
            "dataItem": "dbfs",
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_ways",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "determine_mark_provider",
          "__config__": {
            "label": "拟定标供应商",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 119,
            "fieldLength": "500",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_provider",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "determine_mark_name",
          "__config__": {
            "label": "标的名称",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 120,
            "fieldLength": "100",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_name",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "determine_mark_number",
          "__config__": {
            "label": "标的数量",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 121,
            "fieldLength": "100",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_number",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "determine_mark_model",
          "__config__": {
            "label": "型号",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 122,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_model",
            "bindTableFieldType": "varchar"
          }
        }, {
          "tempType": "textarea",
          "__vModel__": "other_des",
          "__config__": {
            "label": "其他说明",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "textarea",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 130,
            "fieldLength": 2000,
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "other_des",
            "bindTableFieldType": "varchar"
          }
        }, {
          "tempType": "number",
          "__vModel__": "determine_mark_amount",
          "computationalConfiguration": [],
          "append": "元",
          "__config__": {
            "label": "金额",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input",
            "defaultValue": "",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 123,
            "fieldLength": "50",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "determine_mark_amount",
            "bindTableFieldType": "double"
          }
        }, {
          "__vModel__": "duration_date",
          "__config__": {
            "label": "工期时间",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": false,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 124,
            "fieldLength": "100",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "duration_date",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "meeting_minutes_url",
          "__config__": {
            "label": "定标会议纪要",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": false,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 125,
            "fieldLength": "500",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "meeting_minutes_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "meeting_file_url",
          "__config__": {
            "label": "定标文件",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": false,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 126,
            "fieldLength": "500",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "meeting_file_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "notice_url",
          "__config__": {
            "label": "中标通知书最终版",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": false,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 127,
            "fieldLength": "500",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "notice_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "other_url",
          "__config__": {
            "label": "考察报告及其他附件",
            "tag": "el-upload",
            "avueType": "upload",
            "defaultValue": null,
            "showLabel": true,
            "required": false,
            "span": 24,
            "showTip": false,
            "buttonText": "点击上传",
            "fileSize": 2,
            "sizeUnit": "MB",
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 128,
            "fieldLength": "500",
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "other_url",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "provider_approval",
          "__config__": {
            "label": "指定供应商审批单",
            "showLabel": true,
            "tag": "el-input",
            "avueType": "input-tip",
            "required": true,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 129,
            "fieldLength": 500,
            "bindTable": "oa_determine_mark_approval",
            "bindTableField": "provider_approval",
            "bindTableFieldType": "varchar"
          }
        }, {
          "__vModel__": "field131ec81",
          "__config__": {
            "label": "分割线",
            "showLabel": false,
            "direction": "horizontal",
            "contentPosition": "",
            "tag": "el-divider",
            "top": 0,
            "bottom": 0,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 131
          }
        }, {
          "tempType": "textarea",
          "__vModel__": "field1328bcc",
          "__type__": "opinion",
          "__config__": {
            "label": "意见簿",
            "showLabel": true,
            "tag": "xjr-opinion-comonent",
            "defaultValue": null,
            "span": 24,
            "F_LgMarkCode": "",
            "prestrainField": "",
            "formId": 132
          }
        }]
      };
      return config;
    },
    /**
     * 
     * 定标审批
     */
    selectApprovalForm(val) {
      if (val == 1) {
        this.approvalFormVisible = true
      } else if(val == 2) {
        this.approvalFormVisible2 = true
      } else if(val == 3) {
        this.approvalFormVisible3 = true
      }
    },
    sure(v) {
      if (v == 'del') {
        this.formData['determine_mark_approval'] = ''
      }
      this.$refs.approval.historyTaskData = this.$refs.approval.historyTaskData.filter(e => e.isChecked)
      this.$refs.approval.myTaskData = this.$refs.approval.myTaskData.filter(e => e.isChecked)
      this.$refs.approval.manualTaskData = this.$refs.approval.manualTaskData.filter(e => e.isChecked)
      if (this.$refs.approval.historyTaskData && this.$refs.approval.historyTaskData.length > 0) {
        this.$refs.approval.historyTaskData.forEach(element => {
          this.formData['determine_mark_approval'] += element.processInstanceId + ','
        })
      }
      if (this.$refs.approval.myTaskData && this.$refs.approval.myTaskData.length > 0) {
        this.$refs.approval.myTaskData.forEach(element => {
          this.formData['determine_mark_approval'] += element.processInstanceId + ','
        })
      }
      if (this.$refs.approval.manualTaskData && this.$refs.approval.manualTaskData.length > 0) {
        this.$refs.approval.manualTaskData.forEach(element => {
          this.formData['determine_mark_approval'] += element.processInstanceId + ','
        })
      }
      console.log(...this.$refs.approval.historyTaskData, ...this.$refs.approval.myTaskData, ...this.$refs.approval.manualTaskData);
      this.selectData = [...this.$refs.approval.historyTaskData, ...this.$refs.approval.myTaskData, ...this.$refs.approval.manualTaskData]
      this.approvalFormVisible = false
    },
    delApproval(item, index) {
      if (this.$refs.approval.historyTaskData.includes(item)) {
        this.$refs.approval.historyTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval.historyTaskData.splice(i, 1)
          }
        })
      }
      if (this.$refs.approval.myTaskData.includes(item)) {
        this.$refs.approval.myTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval.myTaskData.splice(i, 1)
          }
        })
      }
      if (this.$refs.approval.manualTaskData.includes(item)) {
        this.$refs.approval.manualTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval.manualTaskData.splice(i, 1)
          }
        })
      }
      this.sure('del')
    },
    // end
    /**
     * 最低价
     * 实地考察
     */
    sure2(v) {
      if (v == 'del') {
        this.formData['determine_mark_provider'] = ''
      }
      this.$refs.approval2.historyTaskData = this.$refs.approval2.historyTaskData.filter(e => e.isChecked)
      this.$refs.approval2.myTaskData = this.$refs.approval2.myTaskData.filter(e => e.isChecked)
      this.$refs.approval2.manualTaskData = this.$refs.approval2.manualTaskData.filter(e => e.isChecked)
      if (this.$refs.approval2.historyTaskData && this.$refs.approval2.historyTaskData.length > 0) {
        this.$refs.approval2.historyTaskData.forEach(element => {
          this.formData['determine_mark_provider'] += element.processInstanceId + ','
        })
      }
      if (this.$refs.approval2.myTaskData && this.$refs.approval2.myTaskData.length > 0) {
        this.$refs.approval2.myTaskData.forEach(element => {
          this.formData['determine_mark_provider'] += element.processInstanceId + ','
        })
      }
      if (this.$refs.approval2.manualTaskData && this.$refs.approval2.manualTaskData.length > 0) {
        this.$refs.approval2.manualTaskData.forEach(element => {
          this.formData['determine_mark_provider'] += element.processInstanceId + ','
        })
      }
      this.selectData2 = [...this.$refs.approval2.historyTaskData, ...this.$refs.approval2.myTaskData, ...this.$refs.approval2.manualTaskData]
      this.approvalFormVisible2 = false
    },
    delApproval2(item, index) {
      if (this.$refs.approval2.historyTaskData.includes(item)) {
        this.$refs.approval2.historyTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval2.historyTaskData.splice(i, 1)
          }
        })
      }
      if (this.$refs.approval2.myTaskData.includes(item)) {
        this.$refs.approval2.myTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval2.myTaskData.splice(i, 1)
          }
        })
      }
      if (this.$refs.approval2.manualTaskData.includes(item)) {
        this.$refs.approval2.manualTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval2.manualTaskData.splice(i, 1)
          }
        })
      }
      this.sure2('del')
    },
    // end
    /**
     * 指定厂家
     */
    sure3(v) {
      if (v == 'del') {
        this.formData['provider_approval'] = ''
      }
      this.$refs.approval3.historyTaskData = this.$refs.approval3.historyTaskData.filter(e => e.isChecked)
      this.$refs.approval3.myTaskData = this.$refs.approval3.myTaskData.filter(e => e.isChecked)
      this.$refs.approval3.manualTaskData = this.$refs.approval3.manualTaskData.filter(e => e.isChecked)
      if (this.$refs.approval3.historyTaskData && this.$refs.approval3.historyTaskData.length > 0) {
        this.$refs.approval3.historyTaskData.forEach(element => {
          this.formData['provider_approval'] += element.processInstanceId + ','
        })
      }
      if (this.$refs.approval3.myTaskData && this.$refs.approval3.myTaskData.length > 0) {
        this.$refs.approval3.myTaskData.forEach(element => {
          this.formData['provider_approval'] += element.processInstanceId + ','
        })
      }
      if (this.$refs.approval3.manualTaskData && this.$refs.approval3.manualTaskData.length > 0) {
        this.$refs.approval3.manualTaskData.forEach(element => {
          this.formData['provider_approval'] += element.processInstanceId + ','
        })
      }
      this.selectData3 = [...this.$refs.approval3.historyTaskData, ...this.$refs.approval3.myTaskData, ...this.$refs.approval3.manualTaskData]
      this.approvalFormVisible3 = false
    },
    delApproval3(item, index) {
      if (this.$refs.approval3.historyTaskData.includes(item)) {
        this.$refs.approval3.historyTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval3.historyTaskData.splice(i, 1)
          }
        })
      }
      if (this.$refs.approval3.myTaskData.includes(item)) {
        this.$refs.approval3.myTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval3.myTaskData.splice(i, 1)
          }
        })
      }
      if (this.$refs.approval3.manualTaskData.includes(item)) {
        this.$refs.approval3.manualTaskData.forEach((e, i) => {
          if (e == item) {
            this.$refs.approval3.manualTaskData.splice(i, 1)
          }
        })
      }
      this.sure3('del')
    },
    // end
  }
}

</script>
<style>
.el-table__empty-block {
  width: 100% !important;
}

.avue-form__row {
  padding: 0 !important;
}

#editorphone {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #E4E7ED;
  padding: 0 7.5px;
  background: #f5f6fa;
  height: 700px;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 5px;
}

#editorphone .el-col {
  border-bottom: 1px solid #F2F2F2;
  background: #fff;
  margin-bottom: 0;
  padding: 0 15px 6px !important;
  width: 100%;
}

#editorphone .el-form-item__label {
  line-height: 20px
}

#editorphone .el-input-group .el-input__inner {
  background: #f5f6fa
}

#editorphone .el-input__inner {
  border: 0
}

#editorphone .el-input-group__append,
#editorphone .el-input-group__prepend {
  border: 0;
  background: #edeef2;
  color: #666;
}

#editorphone .el-input-group .el-input__prefix {
  left: 44px
}

#editorphone .el-input-group .el-input__suffix {
  right: 44px
}

#editorphone .el-form-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-flow: wrap;
}

#editorphone .el-form-item__label {
  float: none;
  min-width: 85px;
  width: auto !important;
  text-align: left;
  flex: auto;
}

#editorphone .tinymce .el-form-item__label {
  min-width: 100%;
}

#editorphone .el-form-item__content {
  margin-left: 0px !important;
  flex: auto;
  width: calc(100% - 95px);
}

#editorphone .avueFormNoLable .el-form-item__label,
#editorphone .avueFormNoLable .avue-crud__pagination {
  display: none;
}

#editorphone .avueFormNoLable .el-collapse-item__wrap,
#editorphone .avueFormNoLable .el-collapse {
  border-bottom: 0
}

#editorphone .avueFormNoLable .el-col {
  border-bottom: 0;
  padding-bottom: 0
}

#editorphone .el-form-item__content .el-button:first-child {
  margin-left: 90px;
}

.el-upload__tip {
  line-height: 1.2;
}
</style>
